<header class="topbar">
	<nav class="navbar navbar-inverse navbar-head navbar-fixed-top">
		<div class="container-fluid">
		    <div class="navbar-header">
		    	<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
		        <span class="sr-only">切换导航</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
		      <a class="navbar-brand" href="{{ url('admin') }}">
		      	客户管理系统
		      </a>
		    </div>
		    <div class="collapse navbar-collapse">
				<ul class="nav navbar-nav top-nav">
				@foreach($menu as $value)
					@if (isset($value['children']))
						<li class="treeview dropdown {{ (isset($navTopLabel) && $value['label'] == $navTopLabel) ? 'active' : '' }}" data-label="{{ $value['label'] or '' }}" text="{{ $value['name'] }}">
						<a href="#" class="dropdown-toggle" data-id="{{ $value['id'] }}" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
							{{ $value['name'] }}
							<span class="caret"></span>
						</a>
						@if (isset($value['children']))
							<ul class="dropdown-menu">
								@foreach($value['children'] as $children)
								<li><a href="{{ url($children['url']) }}">{{ $children['name'] }}</a></li>
								@endforeach
							</ul>
						@endif
						</li>
					@else
						<li class="treeview" data-label="{{ $value['label'] or '' }}" text="{{ $value['name'] }}">
							<a href="{{ url($value['url']) }}">{{ $value['name'] }}</a>
						</li>
					@endif
				@endforeach
				</ul>
				<ul class="nav navbar-nav navbar-right login-info">
					<li><a href="{{ url('admin/user/password-modify') }}"><i class="fa fa-key"></i> 修改密码</a></li>
					<li><p class="navbar-text"><i class="fa fa-users"></i> {{ $user->group->name }}</a></li>
					<li><p class="navbar-text"><i class="fa fa-user"></i> {{ $user->name }}</a></li>
					<li><a href="{{ url('auth/logout') }}"><i class="fa fa-sign-out"></i> 退出系统</a></li>
				</ul>
		    </div>
		</div>
	</nav>
</header>
<script>
	// var url = window.location.href;
	// $('.top-nav a[href="'+url+'"]:first').closest('.treeview').addClass('active');
</script>